#include <ClassFactoryObjectOsg.h>
#include <iostream>
#include <OsgClassDataSource/ObjectOsg.h>
#include <OsgClassDataSource/NodeOsg.h>
#include <OsgClassDataSource/GroupOsg.h>
#include <OsgClassDataSource/TransformOsg.h>
#include <OsgClassDataSource/MatrixTransformOsg.h>
#include <OsgClassDataSource/DOFTransformOsg.h>
#include <OsgClassDataSource/GeodeOsg.h>
#include <OsgClassDataSource/FileNodeOsg.h>
#include <OsgClassDataSource/ModelRootOsg.h>
#include <OsgClassDataSource/Point3DOsg.h>
#include <OsgClassDataSource/Trajectory3DOsg.h>
#include <OsgClassDataSource/SceneViewerOsg.h>
#include <OsgClassDataSource/TrackballManipulatorOsg.h>
#include <OsgClassDataSource/GeodeSphereOsg.h>
#include <OsgClassDataSource/HudNodeOsg.h>
#include <OsgClassDataSource/SkyBoxOsg.h>
#include <OsgClassDataSource/Trajectory3DManagerOsg.h>
#include <OsgClassDataSource/CameraManipulatorIntersectionOsg.h>
ClassFactoryObjectOsg::ClassFactoryObjectOsg( ): ClassFactoryObject()
{

}

ClassFactoryObjectOsg::~ClassFactoryObjectOsg()
{

}

EObject *ClassFactoryObjectOsg::creatObject(const QString &type_name)
{
    if(type_name == "ObjectOsg" )
    {
        return new ObjectOsg();
    }
    else if(type_name == "NodeOsg" )
    {
        return new NodeOsg();
    }
    else if(type_name == "GroupOsg")
    {
        return new GroupOsg();
    }
    else if(type_name == "TransformOsg")
    {
        return new TransformOsg();
    }
    else if(type_name == "MatrixTransformOsg")
    {
        return new MatrixTransformOsg;
    }
    else if(type_name == "DOFTransformOsg")
    {
        return new DOFTransformOsg;
    }
    else if(type_name == "GeodeOsg")
    {
        return new GeodeOsg();
    }
    else if(type_name == "FileNodeOsg")
    {
        return new FileNodeOsg();
    }
    else if(type_name == "ModelRootOsg")
    {
        return new ModelRootOsg();
    }
    else if(type_name == "Point3DOsg")
    {
        return new Point3DOsg();
    }
    else if(type_name == "Trajectory3DOsg")
    {
        return new Trajectory3DOsg();
    }
    else if(type_name == "SceneViewerOsg")
    {
        return new SceneViewerOsg();
    }
    else if(type_name == "TrackballManipulatorOsg")
    {
        return new TrackballManipulatorOsg();
    }
    else if(type_name == "GeodeSphereOsg")
    {
        return new GeodeSphereOsg();
    }
    else if(type_name == "HudNodeOsg")
    {
        return new HudNodeOsg();
    }
    else if(type_name == "SkyBoxOsg")
    {
        return new SkyBoxOsg();
    }
    else if(type_name == "Trajectory3DManagerOsg")
    {
        return new Trajectory3DManagerOsg();
    }
    else if(type_name == "CameraManipulatorIntersectionOsg")
    {
        return new CameraManipulatorIntersectionOsg();
    }

    return NULL;

}

QList<QSharedPointer<EObject> > ClassFactoryObjectOsg::generateObjectList()
{
    QList<QSharedPointer<EObject>> object_list;
    {
        EObject* objPtr = new ObjectOsg;
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new NodeOsg;
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new GroupOsg;
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new TransformOsg();
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new MatrixTransformOsg();
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new DOFTransformOsg();
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new GeodeOsg();
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new FileNodeOsg("");
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new ModelRootOsg();
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new Point3DOsg();
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new Trajectory3DOsg();
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new SceneViewerOsg();
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new TrackballManipulatorOsg();
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new GeodeSphereOsg();
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new HudNodeOsg();
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new SkyBoxOsg();
        //std::cout<<"SkeBoxOsgPtr ="<<(int)objPtr<<std::endl;
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new Trajectory3DManagerOsg();
        object_list.push_back(objPtr->getSharedPtr());
    }
    {
        EObject* objPtr = new CameraManipulatorIntersectionOsg();
        object_list.push_back(objPtr->getSharedPtr());
    }
    return object_list;
}
